FROM ubuntu:latest
LABEL authors="wm"

ENTRYPOINT ["top", "-b"]

# 构建阶段
FROM golang:1.20 as builder
WORKDIR /app
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o main .

# 运行阶段
FROM alpine:latest
COPY --from=builder /app/main .
COPY --from=builder /app/config.yaml .
EXPOSE 8080
CMD ["./main"]